<?php

//$rs_al = getAccessList();
//$row_rs_al = mysql_fetch_assoc($rs_al);
//$totalRows_rs_al = mysql_num_rows($rs_al);
$msg="";
$rs_fxn = getSiteLinks($SITE_ID);
$row_rs_fxn = mysql_fetch_assoc($rs_fxn);
$totalRows_rs_fxn = mysql_num_rows($rs_fxn);

?>

<form method="post"  action="<?php echo $editFormAction; ?>" id="frmusadd" name="frmusadd">
    <table width="100%" align="center">
        <tr valign="baseline">
            <td colspan="3" align="right" nowrap>Adding User</td>
        </tr><tr valign="baseline">
            <td colspan="3" nowrap><div id="error"><?php echo $msg; ?></div></td>
        </tr>
        <tr valign="baseline">
            <td width="25%" align="right" nowrap>Username:</td>
            <td><input type="text" name="username" id="username" value="" size="32" onblur="checkUser(this.value,'error')"></td>
            <td width="5%" rowspan="6">&nbsp;</td>
        </tr>
        <tr valign="baseline">
            <td nowrap align="right">Password:</td>
            <td><input type="password" name="password" value="" size="32" id="password"></td>
        </tr>
        <tr valign="baseline">
            <td nowrap align="right">Retype Password:</td>
            <td><input type="password" name="password2" value="" size="32" id="password2"></td>
        </tr>
        <tr valign="baseline">
            <td nowrap align="right">Email:</td>
            <td><input type="text" name="email" value="" size="32" id="email"></td>
        </tr>
        <tr valign="baseline">
            <td nowrap align="right">Accesslevel:</td>
            <td><select name="accesslevel">
               
                    <option value="admin" >Admin</option>
                     <option value="pub" >Publisher</option>
                       
                </select>
                <input name="erlink" type="hidden" id="erlink" value="false" />
            </td>
        <tr valign="baseline">
            <td nowrap align="right">Select Administrative Functions<br />
                for the New User</td>
            <td id="allround">
                <span class="head"><div style="">
                        <input name="input" type="checkbox" value="achk_0" id="achk_0" onclick="checkUncheck('frmusadd','achk')" />
                        <span id="clickall">Select All</span></div></span>
                <?php for($i=0;$i<count($admin_function);$i++) {?>
                <div class="list33">
                    <input type="checkbox" name="achk<?php echo $i+1;?>" id="achk_<?php echo $i+1;?>" value="<?php echo $admin_function[$i]; ?>">
                        <?php echo $admin_function[$i]; ?>
                </div>
                    <?php }$cnt = $i;
                    do {$cnt++;
                    ?>
                <div class="list33"> <input type="checkbox" name="achk<?php echo $cnt;?>" id="achk_<?php echo $cnt;?>" value="<?php echo $row_rs_fxn['content_id']; ?>">
                    <?php echo $row_rs_fxn['category_name']; ?></div>
    <?php 

} while ($row_rs_fxn = mysql_fetch_assoc($rs_fxn)); ?>
                <div style="clear:both"></div></td>
        <tr valign="baseline">
            <td nowrap align="right"></td>
            <td><input name="Submit" type="submit" onclick="return validateUserForm('password','password2')" value="Add User"></td>
        </tr>
    </table>
    <input type="hidden" name="MM_insert" value="adminuseraddfrm">
</form>

<?php

mysql_free_result($rs_fxn);
?>
